export {}

class Person{
    name: string='mike';
    getName():void{
        console.log(this.name)
    }
}
const p1 = new Person()
p1.name = 'mike'
p1.getName()

// 定义存取器
class User{
    // myName:string;
    constructor(public myName:string){
        // this.myName = myName
    }
    get name(){
        return this.myName
    }
    set name(value){
        this.myName = value
    }
}
let user = new User('mike')
user.name = 'kate'
console.log(user.name)

//  public

class Animal{
    public readonly name:string;
    constructor(name:string){
        this.name = name
    }
    changeName(name: string){
        this.name = name
    }
}
// public protected private 
